attribute vec4 position; 
attribute vec4 color;
attribute vec4 normal;

uniform vec3 uLightPos;			//	light position

uniform mat4 modelMatrix;		//
uniform mat4 viewMatrix;		//	view matrix for system which uses the light source as the camera position
uniform mat4 projectionMatrix;	//	projection matrix for system which uses the light source as the camera position

varying vec4 pColor;
varying vec3 pEyeVec;			//	vertex_to_eye vector
varying vec3 pLightDir;			//	light_to_vertex vector
varying vec3 pNormal;

void main()
{ 
	gl_Position = projectionMatrix * viewMatrix * modelMatrix * position;
	pColor = color;
	
	vec4 pos = (viewMatrix * modelMatrix * position);
	vec3 vertexPos = normalize(pos.xyz);
	pos = (viewMatrix * vec4(uLightPos, 1.0));
	vec3 lightPos = normalize(pos.xyz);
	pLightDir = vertexPos - lightPos;
	pEyeVec = 0 - vertexPos;
	pNormal = normal.xyz;	
}
